Just-in-time code duplicates extraction

نویسندگان

چکیده

Refactoring is a critical task in software maintenance, and usually performed to enforce better design coding practices, while coping with defects. The Extract Method refactoring widely used for merging duplicate code fragments into single new method. Several studies attempted recommend opportunities using different techniques, including program slicing, dependency graph analysis, change history structural similarity, feature extraction. However, irrespective of the method, most existing approaches interfere developer’s workflow: they require developer stop analyze suggested opportunities, also consider all suggestions entire project without focusing on development context. To increase adoption refactoring, this paper, we aim investigate effectiveness machine learning deep algorithms its recommendation maintaining workflow developer. proposed approach relies mining prior applied refactorings extracting their features train classifier that detects them user’s code. We implemented our as plugin IntelliJ IDEA called AntiCopyPaster. develop approach, trained evaluated various popular models dataset 18,942 from 13 Open Source Apache projects. results show best model Convolutional Neural Network (CNN), which recommends appropriate an F-measure 0.82. conducted qualitative study 72 developers evaluate usefulness developed plugin. tend appreciate idea are satisfied aspects plugin’s operation.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Just-in-time subgrammar extraction for HPSG

We define the basic problem of subgrammar extraction for head-driven phrase structure grammars (HPSG) in the following way: Given a large HPSG grammarG and a set of wordsW , find a small subgrammar of G that accepts the same set of sentences fromW asG, and for each of them produces the same parse trees. The set of words W is obtained from a piece of text. Additionally, we assume that this opera...

متن کامل

Just-In-Time compilation of OCaml byte-code

This paper presents various improvements that were applied to OCamlJit2, a Just-In-Time compiler for the OCaml byte-code virtual machine. OCamlJit2 currently runs on various Unix-like systems with x86 or x86-64 processors. The improvements, including the new x86 port, are described in detail, and performance measures are given, including a direct comparison of OCamlJit2 to OCamlJit.

متن کامل

Just-In-Time Compilers and Dynamic Code Generation

• Partial Evaluation (Run-Time Specialization) Proposed as a way to speed up selected pieces of code. Some function arguments may be known to be (almost) constant at run-time. A specialized (partially evaluated) version of those functions can be generated dynamically, and will hopefully execute faster than the general version. Some of the work done in this area includes: Auslander’s extensions ...

متن کامل

JITSec: Just-in-time Security for Code Injection Attacks

In order to combat code injection attacks, modern operating systems use among others, the Write-XOR-Execute (W⊕X) countermeasure which disallows code execution from writable memory pages. Unfortunately though, a widely used programming technique, namely Just-in-time compilation (JIT), clashes with the use of this countermeasure since its use relies on writable memory where it places dynamically...

متن کامل

Code Generation for Just-in-Time Compiled Mobile Collector Agents

This paper describes MGEN/x86, a toolkit that simplifies the process of creating dynamic code generators and just-in-time (JIT) compilers for the x86 series of processor. MGEN produces pattern-matching code generators based on a userdefined sequence of rules and semantic action associated with each rule. MGEN includes a number of useful and interesting features such as a table driven macro comp...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

ژورنال

عنوان ژورنال: Information & Software Technology

سال: 2023

ISSN: ['0950-5849', '1873-6025']

DOI: https://doi.org/10.1016/j.infsof.2023.107169